package com.hirsi.common.core.validator.annotation;

import com.hirsi.common.core.enums.IVoEnum;
import com.hirsi.common.core.validator.EnumValueValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Constraint(validatedBy = EnumValueValidator.class)
public @interface EnumValue {
    String message() default "必须为指定值";

    Class<? extends IVoEnum> value();

    //是否忽略空值
    boolean ignoreNull() default false;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
